import request from '@/api/request/index'
import type {
  AddDeliveryAskDto,
  CreateSupplierDto,
  ZhongYangKuDepoDanXinXiBuFenCanShuShiYouZhongYangKuDingYiDeQieJiRuGuoGaiZiDuanDeZhiMeiYouXiuGaiYaoChuannull,
  ResultPostring,
  ZhongYangKuChanPinXinXiXiuGaiDTO,
  XinZengCaiGouDingDanRuCan,
  CaiGouDanCaiGouDanSKUKaiPiaoPinMingDto,
  YueDuZhangDanQueRenDto,
  SKUCaiGouXinXiFanHui,
  ZhongYangKuGengXinskuOemQingQiu,
  GongYingShangFuKuanLeiXingXinXi
} from './_interfaces.ts'

/** 添加货期咨询 */
export function provideCenterProductAddDeliveryAsk(data: AddDeliveryAskDto): Promise<any> {
  return request.post('/api/provide/centerProduct/addDeliveryAsk', data)
}

/** 创建供应商 */
export function provideCenterProductCreateSupplier(data: CreateSupplierDto): Promise<any> {
  return request.post('/api/provide/centerProduct/createSupplier', data)
}

/** 更新po的sku信息 */
export function provideCenterProductNewUpdatePoSkuInfo(
  data: ZhongYangKuDepoDanXinXiBuFenCanShuShiYouZhongYangKuDingYiDeQieJiRuGuoGaiZiDuanDeZhiMeiYouXiuGaiYaoChuannull[]
): Promise<any> {
  return request.post('/api/provide/centerProduct/new/updatePoSkuInfo', data)
}

/** 中央库产品信息修改/新增同步 */
export function provideCenterProductProductInfoModify(data: ZhongYangKuChanPinXinXiXiuGaiDTO): Promise<ResultPostring> {
  return request.post('/api/provide/centerProduct/productInfoModify', data)
}

/** 新增采购单信息 */
export function provideCenterProductPurchaseOrder(data: XinZengCaiGouDingDanRuCan[]): Promise<any> {
  return request.post('/api/provide/centerProduct/purchaseOrder', data)
}

/** 新增采购单SKU信息---开票品名修改 */
export function provideCenterProductPurchaseSkuInvoiceName(
  data: CaiGouDanCaiGouDanSKUKaiPiaoPinMingDto
): Promise<string> {
  return request.post('/api/provide/centerProduct/purchaseSkuInvoiceName', data)
}

/** 更新供应商月账单为已确认 */
export function provideCenterProductUpdateMonthBillInfo(data: YueDuZhangDanQueRenDto): Promise<any> {
  return request.post('/api/provide/centerProduct/updateMonthBillInfo', data)
}

/** 中央SKU更新 */
export function provideCenterProductUpdateProductInfo(data: SKUCaiGouXinXiFanHui[]): Promise<any> {
  return request.post('/api/provide/centerProduct/updateProductInfo', data)
}

/** 更新skuOem */
export function provideCenterProductUpdateSkuOem(data: ZhongYangKuGengXinskuOemQingQiu): Promise<any> {
  return request.post('/api/provide/centerProduct/updateSkuOem', data)
}

/** 中央库供应商付款方式修改同步 */
export function provideCenterProductUpdateSupplierPaymentType(data: GongYingShangFuKuanLeiXingXinXi): Promise<any> {
  return request.post('/api/provide/centerProduct/updateSupplierPaymentType', data)
}
